import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/balance_DRN_bill_entity.dart';

BalanceDRNBillEntity $BalanceDRNBillEntityFromJson(Map<String, dynamic> json) {
  final BalanceDRNBillEntity balanceDRNBillEntity = BalanceDRNBillEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    balanceDRNBillEntity.id = id;
  }
  final double? gameType = jsonConvert.convert<double>(json['gameType']);
  if (gameType != null) {
    balanceDRNBillEntity.gameType = gameType;
  }
  final double? createdAt = jsonConvert.convert<double>(json['createdAt']);
  if (createdAt != null) {
    balanceDRNBillEntity.createdAt = createdAt;
  }
  final double? outIn = jsonConvert.convert<double>(json['outIn']);
  if (outIn != null) {
    balanceDRNBillEntity.outIn = outIn;
  }
  final double? drnAmount = jsonConvert.convert<double>(json['drnAmount']);
  if (drnAmount != null) {
    balanceDRNBillEntity.drnAmount = drnAmount;
  }
  final double? year = jsonConvert.convert<double>(json['year']);
  if (year != null) {
    balanceDRNBillEntity.year = year;
  }
  final double? month = jsonConvert.convert<double>(json['month']);
  if (month != null) {
    balanceDRNBillEntity.month = month;
  }
  final double? day = jsonConvert.convert<double>(json['day']);
  if (day != null) {
    balanceDRNBillEntity.day = day;
  }
  final double? type = jsonConvert.convert<double>(json['type']);
  if (type != null) {
    balanceDRNBillEntity.type = type;
  }
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    balanceDRNBillEntity.userId = userId;
  }
  final String? withalRecordId = jsonConvert.convert<String>(
      json['withalRecordId']);
  if (withalRecordId != null) {
    balanceDRNBillEntity.withalRecordId = withalRecordId;
  }
  final double? deletedAt = jsonConvert.convert<double>(json['deletedAt']);
  if (deletedAt != null) {
    balanceDRNBillEntity.deletedAt = deletedAt;
  }
  final double? sales = jsonConvert.convert<double>(json['sales']);
  if (sales != null) {
    balanceDRNBillEntity.sales = sales;
  }
  final double? income = jsonConvert.convert<double>(json['income']);
  if (income != null) {
    balanceDRNBillEntity.income = income;
  }
  final double? level1Sales = jsonConvert.convert<double>(json['level1Sales']);
  if (level1Sales != null) {
    balanceDRNBillEntity.level1Sales = level1Sales;
  }
  final double? level1Income = jsonConvert.convert<double>(
      json['level1Income']);
  if (level1Income != null) {
    balanceDRNBillEntity.level1Income = level1Income;
  }
  final double? level2Sales = jsonConvert.convert<double>(json['level2Sales']);
  if (level2Sales != null) {
    balanceDRNBillEntity.level2Sales = level2Sales;
  }
  final double? level2Income = jsonConvert.convert<double>(
      json['level2Income']);
  if (level2Income != null) {
    balanceDRNBillEntity.level2Income = level2Income;
  }
  final double? level3Sales = jsonConvert.convert<double>(json['level3Sales']);
  if (level3Sales != null) {
    balanceDRNBillEntity.level3Sales = level3Sales;
  }
  final double? level3Income = jsonConvert.convert<double>(
      json['level3Income']);
  if (level3Income != null) {
    balanceDRNBillEntity.level3Income = level3Income;
  }
  final double? consumeDrnAmount = jsonConvert.convert<double>(
      json['consumeDrnAmount']);
  if (consumeDrnAmount != null) {
    balanceDRNBillEntity.consumeDrnAmount = consumeDrnAmount;
  }
  final double? consumeDrnIncome = jsonConvert.convert<double>(
      json['consumeDrnIncome']);
  if (consumeDrnIncome != null) {
    balanceDRNBillEntity.consumeDrnIncome = consumeDrnIncome;
  }
  final double? pledgeDrnAmount = jsonConvert.convert<double>(
      json['pledgeDrnAmount']);
  if (pledgeDrnAmount != null) {
    balanceDRNBillEntity.pledgeDrnAmount = pledgeDrnAmount;
  }
  final double? pledgeDrnIncome = jsonConvert.convert<double>(
      json['pledgeDrnIncome']);
  if (pledgeDrnIncome != null) {
    balanceDRNBillEntity.pledgeDrnIncome = pledgeDrnIncome;
  }
  final String? walletAddress = jsonConvert.convert<String>(
      json['walletAddress']);
  if (walletAddress != null) {
    balanceDRNBillEntity.walletAddress = walletAddress;
  }
  final double? withdrawState = jsonConvert.convert<double>(
      json['withdrawState']);
  if (withdrawState != null) {
    balanceDRNBillEntity.withdrawState = withdrawState;
  }
  final String? typeItem = jsonConvert.convert<String>(json['typeItem']);
  if (typeItem != null) {
    balanceDRNBillEntity.typeItem = typeItem;
  }
  return balanceDRNBillEntity;
}

Map<String, dynamic> $BalanceDRNBillEntityToJson(BalanceDRNBillEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['gameType'] = entity.gameType;
  data['createdAt'] = entity.createdAt;
  data['outIn'] = entity.outIn;
  data['drnAmount'] = entity.drnAmount;
  data['year'] = entity.year;
  data['month'] = entity.month;
  data['day'] = entity.day;
  data['type'] = entity.type;
  data['userId'] = entity.userId;
  data['withalRecordId'] = entity.withalRecordId;
  data['deletedAt'] = entity.deletedAt;
  data['sales'] = entity.sales;
  data['income'] = entity.income;
  data['level1Sales'] = entity.level1Sales;
  data['level1Income'] = entity.level1Income;
  data['level2Sales'] = entity.level2Sales;
  data['level2Income'] = entity.level2Income;
  data['level3Sales'] = entity.level3Sales;
  data['level3Income'] = entity.level3Income;
  data['consumeDrnAmount'] = entity.consumeDrnAmount;
  data['consumeDrnIncome'] = entity.consumeDrnIncome;
  data['pledgeDrnAmount'] = entity.pledgeDrnAmount;
  data['pledgeDrnIncome'] = entity.pledgeDrnIncome;
  data['walletAddress'] = entity.walletAddress;
  data['withdrawState'] = entity.withdrawState;
  data['typeItem'] = entity.typeItem;
  return data;
}

extension BalanceDRNBillEntityExt on BalanceDRNBillEntity {
  BalanceDRNBillEntity copyWith({
    String? id,
    double? gameType,
    double? createdAt,
    double? outIn,
    double? drnAmount,
    double? year,
    double? month,
    double? day,
    double? type,
    String? userId,
    String? withalRecordId,
    double? deletedAt,
    double? sales,
    double? income,
    double? level1Sales,
    double? level1Income,
    double? level2Sales,
    double? level2Income,
    double? level3Sales,
    double? level3Income,
    double? consumeDrnAmount,
    double? consumeDrnIncome,
    double? pledgeDrnAmount,
    double? pledgeDrnIncome,
    String? walletAddress,
    double? withdrawState,
    String? typeItem,
  }) {
    return BalanceDRNBillEntity()
      ..id = id ?? this.id
      ..gameType = gameType ?? this.gameType
      ..createdAt = createdAt ?? this.createdAt
      ..outIn = outIn ?? this.outIn
      ..drnAmount = drnAmount ?? this.drnAmount
      ..year = year ?? this.year
      ..month = month ?? this.month
      ..day = day ?? this.day
      ..type = type ?? this.type
      ..userId = userId ?? this.userId
      ..withalRecordId = withalRecordId ?? this.withalRecordId
      ..deletedAt = deletedAt ?? this.deletedAt
      ..sales = sales ?? this.sales
      ..income = income ?? this.income
      ..level1Sales = level1Sales ?? this.level1Sales
      ..level1Income = level1Income ?? this.level1Income
      ..level2Sales = level2Sales ?? this.level2Sales
      ..level2Income = level2Income ?? this.level2Income
      ..level3Sales = level3Sales ?? this.level3Sales
      ..level3Income = level3Income ?? this.level3Income
      ..consumeDrnAmount = consumeDrnAmount ?? this.consumeDrnAmount
      ..consumeDrnIncome = consumeDrnIncome ?? this.consumeDrnIncome
      ..pledgeDrnAmount = pledgeDrnAmount ?? this.pledgeDrnAmount
      ..pledgeDrnIncome = pledgeDrnIncome ?? this.pledgeDrnIncome
      ..walletAddress = walletAddress ?? this.walletAddress
      ..withdrawState = withdrawState ?? this.withdrawState
      ..typeItem = typeItem ?? this.typeItem;
  }
}